﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package com.fminutes.vinciDll.analyze {
    import com.fminutes.vinciDll.*;
    import flash.utils.*;

    public class AnalyzeDictionary {

        private static var instance:AnalyzeDictionary;

        private var analyzeDic:Dictionary;

        public function AnalyzeDictionary(){
            if (instance == null){
                this.analyzeDic = new Dictionary();
                this.analyzeDic[DllFileObject.TYPE_LIB] = LibAnalyze;
                this.analyzeDic[DllFileObject.TYPE_MAIN] = MainAnalyze;
                this.analyzeDic[DllFileObject.TYPE_LIS] = LisAnalyze;
                this.analyzeDic[DllFileObject.TYPE_JSON] = JsonAnalyze;
                this.analyzeDic[DllFileObject.TYPE_DDD] = DDDAnalyze;
                this.analyzeDic[DllFileObject.TYPE_XML] = XMLAnalyze;
                this.analyzeDic[DllFileObject.TYPE_IMG] = ImgAnalyze;
            } else {
                throw (new Error("实例AnalyzeDictionary出错"));
            };
        }
        public static function getInstance():AnalyzeDictionary{
            if (!instance){
                instance = new (AnalyzeDictionary)();
            };
            return (instance);
        }

        public function registerAnalyze(_arg1:String, _arg2:Class):void{
            if (!this.analyzeDic[_arg1]){
                this.analyzeDic[_arg1] = _arg2;
            };
        }
        public function getAnalyze(_arg1:String):AnalyzeBase{
            if ((this.analyzeDic[_arg1] is Class)){
                this.analyzeDic[_arg1] = new ((this.analyzeDic[_arg1] as Class))();
            };
            return (this.analyzeDic[_arg1]);
        }

    }
}//package com.fminutes.vinciDll.analyze 
